angular.module('meMyIntegratDetailControllers', [])

  .controller('MyIntegratDetailCtrl', function ($scope, $state, Storage, MyIntegratDetail) {

    var memberId = Storage.get("member").member_id;

    //进入积分明细界面的数据加载
    $scope.$on('$ionicView.beforeEnter', function () {
      MyIntegratDetail.getMyIntegrateDetail(memberId);
    });

    $scope.$on('Me.MyIntegratDetail', function () {

      var result = MyIntegratDetail.getMyIntegrateDetailJson();
      var detailList = result.pointDetailList;
      //对积分的正负号进行处理
      for(var i=0;i<detailList.length;i++){
        if(detailList[i].mpd_point > 0){
          detailList[i].mpd_point = "+"+detailList[i].mpd_point;
        }
      }
      $scope.detailList = detailList;


    })


  });
